﻿@namespace BootstrapBlazor.Components
@inherits BootstrapModuleComponentBase
@attribute [BootstrapModuleAutoLoader]

<div @attributes="AdditionalAttributes" id="@Id" class="@ClassString" data-bb-zone-id="@ZoneId">
    <CascadingValue Value="this" IsFixed="true">
        @ChildContent
    </CascadingValue>
    <RenderTemplate>
        @foreach (var item in _contextMenuItems)
        {
            var disabled = GetItemTriggerClick(item);
            <DynamicElement @key="item" TagName="div" class="@GetItemClassString(disabled)"
                            TriggerClick="!disabled" OnClick="() => OnClickItem(item)">
                <i class="@GetItemIconString(item)"></i>
                <span>@item.Text</span>
            </DynamicElement>
        }
    </RenderTemplate>
</div>
